home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / lcppb.zip / LCPPLIB.ZIP / TSTRLIST.CPP < prev    next >
C/C++ Source or Header  |  1991-07-08  |  792b  |  34 lines

  1. // tstrlist.cpp -- Test strItem class
  2.  
  3. //#include <stream.hpp>
  4. #include <iostream.h>
  5. #include "stritem.h"
  6. #include "list.h"
  7.  
  8. #define CURRENT_STRING ((strItem *)(root->currentItem()))
  9.  
  10. main()
  11. {
  12.   list *root = new list;
  13.  
  14.   root->insertItem(new strItem("First item in list"));
  15.   root->insertItem(new strItem("Second item in list"));
  16.   root->insertItem(new strItem("Third and last item in list"));
  17.  
  18.   if (root->firstItem() != NULL)
  19.   do {
  20.     cout << CURRENT_STRING->getString() << '\n';
  21.     root->nextItem();
  22.   } while (!root->atHeadOfList());
  23.  
  24.   delete root;
  25. }
  26.  
  27.  
  28. // Copyright (c) 1990 by Tom Swan. All rights reserved
  29. // Revision 1.00    Date: 10/30/1990   Time: 07:54 am
  30.  
  31. // Revision 1.01    Date: 07/08/1991   Time: 05:41 pm
  32. // Converted for Borland C++ 2.0
  33.  
  34.